import axios from 'axios';
import {NEWS_URI} from '../utils/common'
/**
 * 获取活动列表
 *
 * @export
 * @returns
 */
export function getactives() {
    return axios.get(`${NEWS_URI}/activity`);
}
/**
 * 晒单详情
 * @param id
 * @param token
 * @returns {*}
 */
export function getdandetailsR(id, token) {
    if(token) {
        return axios.get(`${NEWS_URI}/discovery/share/get?id=${id}`, {
            headers: {
                token
            }
        });
    }
    return axios.get(`${NEWS_URI}/discovery/share/get?id=${id}`);
}
/**
 * 晒单留言
 * @param token
 * @param target
 * @param page
 * @returns {*}
 */
export function getMessagesR({token, page, target}) {
    if(token) {
        return axios.get(`${MASTER_URI}/comment/bySchemeShare?target=${target}&page=${page}&pageSize=20`, {
            headers: {
                token
            }
        });
    }
    else {
        return axios.get(`${MASTER_URI}/comment/bySchemeShare?target=${target}&page=${page}&pageSize=20`);
    }
}